<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>服务归档</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
</head>
<body style="margin: 1px">

<table id="dg" title="服务归档" class="easyui-datagrid" fitColumns="true" pagination="true" rownumbers="true"
       url="${pageContext.request.contextPath}/customerService/list.do?state=已归档" fit="true" toolbar="#dg-tb">
    <thead>
    <tr>
        <th field="cb" checkbox="true" align="center"></th>
        <th field="id" width="50" align="center">编号</th>
        <th field="customer.name" width="100" align="center">客户</th>
        <th field="overview" width="200" align="center">概要</th>
        <th field="serveType" width="100" align="center">服务类型</th>
        <th field="createPeople" width="100" align="center">创建人</th>
        <th field="createTime" width="100" align="center">创建日期</th>
        <th field="state" width="50" align="center" hidden="true">客服服务状态</th>
        <th field="assigner" width="50" align="center" hidden="true">分配人</th>
        <th field="assignTime" width="100" align="center" hidden="true">分配日期</th>
        <th field="serviceProce" width="100" align="center" hidden="true">服务处理</th>
        <th field="serviceProcePeople" width="100" align="center" hidden="true">服务处理人</th>
        <th field="serviceProceTime" width="100" align="center" hidden="true">服务处理日期</th>
        <th field="serviceProceResult" width="50" align="center" hidden="true">服务处理结果</th>
        <th field="myd" width="50" align="center" hidden="true">客户满意度</th>
    </tr>
    </thead>
</table>
<div id="dg-tb">
    <div>
        <a href="javascript:openCustomerServiceFileDialog()" class="easyui-linkbutton" iconCls="icon-fwgd" plain="true">查看客户服务详情</a>
    </div>
    <div>
        &nbsp;客户名称：&nbsp;<input class="easyui-textbox" id="s_customer" size="20"/>
        &nbsp;概要：&nbsp;<input class="easyui-textbox" id="s_overview" size="20"/>
        &nbsp;服务类型：&nbsp;<input class="easyui-combobox" required="true" id="s_serveType" name="s_serveType" data-options="panelHeight:'auto',editable:false,valueField:'dataDicValue',textField:'dataDicValue',url:'${pageContext.request.contextPath}/dataDic/dataDicValueComboList.do?dataDicName=服务类型'"/>
        &nbsp;创建日期：&nbsp;<input type="text" id="s_createTimeFrom" class="easyui-datebox" editable="false"/>&nbsp;-&nbsp;<input type="text" id="s_createTimeTo" class="easyui-datebox" editable="false"/>&nbsp;
        <a href="javascript:searchCustomerService()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
    </div>
</div>

<div id="dlg" class="easyui-dialog" style="width:750px;height:550px;padding: 10px 20px" closed="true" buttons="#dlg-buttons">
    <form id="fm" method="post">
        <table cellspacing="8px">
            <tr>
                <td>服务类型：</td>
                <td><input class="easyui-textbox" id="serveType" name="serveType" readonly="true"/></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>客户：</td>
                <td><input class="easyui-textbox" id="customer.name" name="customer.name" readonly="true"/></td>
            </tr>
            <tr>
                <td>概要：</td>
                <td colspan="4"><input class="easyui-textbox" id="overview" name="overview" style="width: 419px;height: 56px" multiline="true" required="true"/>&nbsp;<font color="red">*</font></td>
            </tr>
            <tr>
                <td>服务请求：</td>
                <td colspan="4"><input class="easyui-textbox" id="serviceRequest" name="serviceRequest" style="width: 419px;height: 56px" multiline="true" required="true">&nbsp;<font color="red">*</font></td>
            </tr>
            <tr>
                <td>创建人：</td>
                <td><input class="easyui-textbox" editable="false" id="createPeople" name="createPeople"/></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>创建时间：</td>
                <td><input class="easyui-textbox" id="createTime" name="createTime" editable="false"/></td>
            </tr>
            <tr>
                <td>分配给：</td>
                <td><input class="easyui-textbox" id="assigner" name="assigner" readonly="readonly"/></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>分配时间：</td>
                <td><input class="easyui-textbox" id="assignTime" name="assignTime" readonly="readonly"/></td>
            </tr>
            <tr>
                <td>服务处理：</td>
                <td colspan="4"><input class="easyui-textbox" id="serviceProce" name="serviceProce" style="width: 419px;height: 56px" multiline="true" required="true">&nbsp;<font color="red">*</font></td>
            </tr>
            <tr>
                <td>处理人：</td>
                <td><input class="easyui-textbox" id="serviceProcePeople" name="serviceProcePeople" readonly="readonly"/></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>处理时间：</td>
                <td><input class="easyui-textbox" id="serviceProceTime" name="serviceProceTime" readonly="readonly"/></td>
            </tr>
            <tr>
                <td>处理结果：</td>
                <td><input class="easyui-textbox" id="serviceProceResult" name="serviceProceResult" required="true"/>&nbsp;<font color="red">*</font></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>客户满意度：</td>
                <td><input class="easyui-textbox" id="myd" name="myd" required="true" style="width: 163px"/>&nbsp;<font color="red">*</font></td>
            </tr>
        </table>
    </form>
</div>

<div id="dlg-buttons">
    <a href="javascript:closeCustomerFileDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
</div>
</body>
</html>
<script type="text/javascript">

    $(function () {
        $('#s_customer,#s_overview').each(function (index, element) {
            $(this).textbox('textbox').bind('keydown', function (e) {
                if (e.keyCode == 13) {   // 当按下回车键时接受输入的值。
                    searchCustomerService();
                }
            });
        });
    });

    function searchCustomerService() {
        $("#dg").datagrid('load', {
            "customer.name": $("#s_customer").textbox("getValue"),
            "overview": $("#s_overview").textbox("getValue"),
            "serveType": $("#s_serveType").combobox("getValue"),
            "createTimeFrom": $("#s_createTimeFrom").datebox("getValue"),
            "createTimeTo": $("#s_createTimeTo").datebox("getValue")
        });
    }

    function openCustomerServiceFileDialog() {
        var selectedRows = $("#dg").datagrid("getSelections");
        if (selectedRows.length != 1) {
            $.messager.alert("系统提示", "请选择一条要查看的客户服务数据！");
            return;
        }
        var row = selectedRows[0];
        $("#dlg").dialog("open").dialog("setTitle", "客服服务详情");
        $("#fm").form("load", row);
        url = "${pageContext.request.contextPath}/customerService/save.do?id=" + row.id;
    }


    function closeCustomerFileDialog() {
        $("#dlg").dialog("close");
    }
</script>